package io.gitee.zhangbinhub.admin.authentication

import org.springframework.security.authentication.AbstractAuthenticationToken
import org.springframework.security.core.Authentication
import org.springframework.security.core.GrantedAuthority

class OauthUserPasswordAuthenticationRequest(
    private val principal: Any?,
    private val credentials: Any?,
    val clientPrincipal: Authentication,
    authorities: Collection<GrantedAuthority?>?,
    val additionalParameters: Map<String, Any>
) : AbstractAuthenticationToken(authorities) {
    override fun getPrincipal(): Any? {
        return principal
    }

    override fun getCredentials(): Any? {
        return credentials
    }

    companion object {
        private const val serialVersionUID = 8370701114478265244L
    }
}